/* 语音通话组件样式 */
.voice-call-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(10px);
}

.voice-call-container {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 30px;
  width: 350px;
  max-width: 90vw;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.voice-call-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.user-info {
  position: relative;
  z-index: 2;
  margin-bottom: 30px;
}

.user-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 15px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.user-avatar:hover {
  transform: scale(1.05);
}

.user-name {
  font-size: 24px;
  font-weight: 600;
  color: white;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.call-status {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 20px;
  font-weight: 500;
}

.call-duration {
  font-size: 18px;
  color: #4ade80;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.call-info {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 15px;
  margin: 20px 0;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.call-info p {
  margin: 5px 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.call-info .status-icon {
  font-size: 16px;
  margin-left: 8px;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
  position: relative;
  z-index: 2;
}

.control-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.control-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
}

.control-button:hover::before {
  width: 100%;
  height: 100%;
}

.control-button:hover {
  transform: scale(1.1);
}

.control-button:active {
  transform: scale(0.95);
}

.control-button svg {
  width: 24px;
  height: 24px;
  z-index: 1;
  position: relative;
}

/* 接听按钮 */
.accept-button {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  color: white;
}

.accept-button:hover {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

/* 拒绝按钮 */
.reject-button {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.reject-button:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* 静音按钮 */
.mute-button {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  color: white;
}

.mute-button.muted {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.mute-button:hover {
  background: linear-gradient(135deg, #4b5563, #374151);
}

.mute-button.muted:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

/* 挂断按钮 */
.hangup-button {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.hangup-button:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* 测试按钮 */
.test-button {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
}

.test-button:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* 来电动画 */
.incoming-call {
  animation: incomingPulse 1.5s ease-in-out infinite;
}

@keyframes incomingPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
  }
}

/* 呼叫中动画 */
.calling {
  animation: callingPulse 2s ease-in-out infinite;
}

@keyframes callingPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* 通话中状态 */
.call-active {
  background: linear-gradient(135deg, #10b981, #059669);
}

.call-active::before {
  animation: none;
}

/* 响应式设计 */
@media (max-width: 480px) {
  .voice-call-container {
    width: 320px;
    padding: 25px;
  }

  .user-avatar {
    width: 70px;
    height: 70px;
  }

  .user-name {
    font-size: 20px;
  }

  .control-button {
    width: 50px;
    height: 50px;
  }

  .control-button svg {
    width: 20px;
    height: 20px;
  }

  .controls {
    gap: 15px;
  }
}

/* 隐藏的音频元素 */
.audio-elements {
  display: none;
}

/* 状态指示器 */
.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-indicator.connected {
  background: #4ade80;
  animation: statusBlink 2s ease-in-out infinite;
}

.status-indicator.connecting {
  background: #f59e0b;
  animation: statusBlink 1s ease-in-out infinite;
}

.status-indicator.disconnected {
  background: #ef4444;
}

@keyframes statusBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}
